<?php

namespace app\api\controller;

use think\Controller;

/*
 * 基类
 */

/**
 * ============================================================================
 * DSMall多用户商城
 * ============================================================================
 * 版权所有 2014-2028 长沙德尚网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.csdeshang.com
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
 * 不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * 控制器
 */
class MobileHome extends Controller {

    //客户端类型
    protected $client_type_array = array('android', 'wap', 'wechat', 'ios', 'windows', 'jswechat');
    //列表默认分页数
    protected $pagesize = 5;

    public function _initialize() {
        parent::_initialize();

        header("Access-Control-Allow-Origin: *");

        //分页数处理
        $pagesize = intval(input('param.per_page'));
        if ($pagesize > 0) {
            $this->pagesize = $pagesize;
        } else {
            $this->pagesize = 10;
        }
        /* 加入配置信息 */
        $config_list = rkcache('config', true);
        config($config_list);
    }


    /**
     * 返回过滤对应的用户信息
     * @param type $member_info
     * @return type
     */
    protected function getMemberUser($member_info) {
        return array(
            'member_id' => $member_info['member_id'],
            'member_name' => $member_info['member_name'],
            'member_truename' => $member_info['member_truename'],
            'member_nickname' => $member_info['member_nickname'],
            'member_avatar' => get_member_avatar($member_info['member_avatar']),
            'member_points' => $member_info['member_points'],
            'member_email' => $member_info['member_email'],
            'member_mobile' => $member_info['member_mobile'],
            'member_sex' => $member_info['member_sex'],
            'member_qq' => $member_info['member_qq'],
            'member_ww' => $member_info['member_ww'],
            'member_birthday' => date('Y-m-d',$member_info['member_birthday']),
            'member_auth_state' => $member_info['member_auth_state'],
            'member_idcard_image1_url' => get_member_idcard_image($member_info['member_idcard_image1']),
            'member_idcard_image2_url' => get_member_idcard_image($member_info['member_idcard_image2']),
            'member_idcard_image3_url' => get_member_idcard_image($member_info['member_idcard_image3']),
            'member_golds' =>$member_info['member_golds'],
            'member_money' =>$member_info['member_money'],
            'auth_type' =>$member_info['auth_type'],
//            'like_num' =>$member_info['like_num'],
//            'like_end_time' =>$member_info['like_end_time'],
//            'is_like_vip' =>$member_info['is_like_vip'],

        );
    }
    /**
     * 返回过滤对应的用户信息
     * @param type $seller_info
     * @return type
     */
    protected function getSellerUser($seller_info,$store_info) {
        return array(
            'store_id'=>$store_info['store_id'],
            'member_id' => $seller_info['member_id'],
            'seller_id' => $seller_info['seller_id'],
            'seller_name' => $seller_info['seller_name'],
            'store_avatar'=>get_store_logo($store_info['store_avatar']),
            'is_platform_store' => $store_info['is_platform_store'],
            'storeclass_id'=>$store_info['storeclass_id'],
        );
    }
}

?>
